﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VelocityShop.Entities;

namespace VelocityShop
{
    public class CatalogView:Catalog 
    {
        public string CurrentCategory {get;set;}
        public string CurrentTag {get;set;}

        public CatalogView(string catalogId, string currency):base(catalogId,currency)
        {
            
        }

        public override IList<CatalogItem> Items
        {
            get
            {
                if (base._items == null)
                {
                    if (CurrentTag==string.Empty)
                        _items = CatalogManager.GetItemsByCategory(CurrentCategory);
                    else
                        _items = CatalogManager.GetItemsByTag(CurrentCategory,CurrentTag);
                }

                return _items;
            }
        }
    }
}
